/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package podologia.beansDB;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Hernan
 */
@Entity
@Table(name = "tratapatoxatencion")
@NamedQueries({@NamedQuery(name = "Tratapatoxatencion.findAll", query = "SELECT t FROM Tratapatoxatencion t"), @NamedQuery(name = "Tratapatoxatencion.findByZona", query = "SELECT t FROM Tratapatoxatencion t WHERE t.zona = :zona"), @NamedQuery(name = "Tratapatoxatencion.findByIdtratapatoxatencion", query = "SELECT t FROM Tratapatoxatencion t WHERE t.idtratapatoxatencion = :idtratapatoxatencion")})
public class Tratapatoxatencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "zona")
    private String zona;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Basic(optional = false)
    @Column(name = "idtratapatoxatencion")
    private Integer idtratapatoxatencion;
    @JoinColumn(name = "idTrataPato", referencedColumnName = "idTrataPato")
    @ManyToOne(optional = false)
    private Trataxpatologia idTrataPato;
    @JoinColumn(name = "idAtencion", referencedColumnName = "idAtencion")
    @ManyToOne(optional = false)
    private Atencion idAtencion;

    public Tratapatoxatencion() {
    }

    public Tratapatoxatencion(Integer idtratapatoxatencion) {
        this.idtratapatoxatencion = idtratapatoxatencion;
    }

    public String getZona() {
        return zona;
    }

    public void setZona(String zona) {
        this.zona = zona;
    }

    public Integer getIdtratapatoxatencion() {
        return idtratapatoxatencion;
    }

    public void setIdtratapatoxatencion(Integer idtratapatoxatencion) {
        this.idtratapatoxatencion = idtratapatoxatencion;
    }

    public Trataxpatologia getIdTrataPato() {
        return idTrataPato;
    }

    public void setIdTrataPato(Trataxpatologia idTrataPato) {
        this.idTrataPato = idTrataPato;
    }

    public Atencion getIdAtencion() {
        return idAtencion;
    }

    public void setIdAtencion(Atencion idAtencion) {
        this.idAtencion = idAtencion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtratapatoxatencion != null ? idtratapatoxatencion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tratapatoxatencion)) {
            return false;
        }
        Tratapatoxatencion other = (Tratapatoxatencion) object;
        if ((this.idtratapatoxatencion == null && other.idtratapatoxatencion != null) || (this.idtratapatoxatencion != null && !this.idtratapatoxatencion.equals(other.idtratapatoxatencion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "javaapplication2.Tratapatoxatencion[idtratapatoxatencion=" + idtratapatoxatencion + "]";
    }

}
